The first thing that you want to say is:
    import Gcrypt

That'll give you access to some classes and fuctions:

        d = PkGenerate(algo, keylen)
        
algo must be a string containing one of the following: 
    RSA, DSA, ELG, ELGAMAL
        (ELG is short for ELGAMAL)

keylen is the requested key length in bits.

d is a dictionary with the public and private keys in it,
    you probably want to say public, private = d["public"], d["private]

        ciphertext = public.Encrypt(plaintext)
        plaintext = private.Decrypt(ciphertext)
    As usual, you almost always want to be using public key cryptography
    for a session key, and not for the actual message.

        sig = private.Sign(message, algo)
algo wants to be a string with the name of one of the supported hash 
    algorithims, see section 3 "Hash Functions".

        result = public.Verify(sig, message, algo)
result will be 1 for success and 0 for failure

algo is the same hash algo that was used to create the signature.

        sig = private.SignHash(hash, algo)
        result = public.VerifyHash(sig, hash, algo)
    In case you're making your own hashes.
